
<%@ page import="net.comic.entities.Page" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title><g:message code="page.create" default="Create Page" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir: '')}"><g:message code="home" default="Home" /></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="page.list" default="Page List" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="page.create" default="Create Page" /></h1>
            <g:if test="${flash.message}">
	            <div class="message"><g:message code="${flash.message}" args="${flash.args}" default="${flash.defaultMessage}" /></div>
            </g:if>
            <g:hasErrors bean="${pageInstance}">
	            <div class="errors">
	                <g:renderErrors bean="${pageInstance}" as="list" />
    	        </div>
            </g:hasErrors>
            <g:form action="save" method="post" >
	            <table>
	                <tr>
                    	<td>
                           <label for="name"><g:message code="page.name" default="Name" />:</label>
                        </td>
                        <td valign="top" class="value ${hasErrors(bean: pageInstance, field: 'name', 'errors')}">
                  			<g:textField name="name" maxlength="50" value="${fieldValue(bean: pageInstance, field: 'name')}" />
                        </td>
                    </tr>
                        
                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="description"><g:message code="page.description" default="Description" />:</label>
                        </td>
                        <td valign="top" class="value ${hasErrors(bean: pageInstance, field: 'description', 'errors')}">
                            <g:textArea name="description" rows="5" cols="40" value="${fieldValue(bean: pageInstance, field: 'description')}" />

                        </td>
                    </tr>
                        
                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="imagePath"><g:message code="page.imagePath" default="Image Path" />:</label>
                        </td>
                        <td valign="top" class="value ${hasErrors(bean: pageInstance, field: 'imagePath', 'errors')}">
                            <g:textField name="imagePath" value="${fieldValue(bean: pageInstance, field: 'imagePath')}" />

                        </td>
                    </tr>
                        
                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="numberPage"><g:message code="page.numberPage" default="Number Page" />:</label>
                        </td>
                        <td valign="top" class="value ${hasErrors(bean: pageInstance, field: 'numberPage', 'errors')}">
                            <g:textField name="numberPage" value="${fieldValue(bean: pageInstance, field: 'numberPage')}" />

                        </td>
                    </tr>
                </table>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'create', 'default': 'Create')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>